<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">

    <link rel="stylesheet" href="/css/layui.css">
    <link rel="stylesheet" href="/css/dp01.css">
    <script src="/js/jquery-3.7.1.min.js"></script>
</head>
<body>

<div class="container">
    <div class="layui-row">
        <div class="layui-col-xs12">

        </div>
    </div>

    <!-- 添加查询表单 -->
    <div class="layui-row" style="margin-top: 10px;">
        <form class="layui-form" id="searchForm">
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">姓名</label>
                    <div class="layui-input-inline">
                        <input type="text" name="name" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">学号</label>
                    <div class="layui-input-inline">
                        <input type="text" name="number" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">性别</label>
                    <div class="layui-input-inline">
                        <select name="sex">
                            <option value="">全部</option>
                            <option value="男">男</option>
                            <option value="女">女</option>
                        </select>
                    </div>
                </div>
                <div class="layui-inline">
                    <button class="layui-btn" lay-submit lay-filter="search">查询</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </form>
    </div>

    <div class="layui-row">
        <div class="layui-col-xs12">
            <button type="button" id="btnAdd" class="layui-btn layui-btn-primary layui-btn-sm">
                <i class="layui-icon layui-icon-addition"></i> 添加学生
            </button>
        </div>
    </div>
    <div class="layui-row">
        <div class="layui-col-xs12">
            <table class="layui-table" lay-even>
                <thead>
                <tr>
                    <th>id</th>
                    <th>姓名</th>
                    <th>性别</th>
                    <th>年龄</th>
                    <th>学号</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody id="studentTb"></tbody>
            </table>
        </div>
    </div>

    <!-- 分页控件 -->
    <div class="layui-row">
        <div class="layui-col-xs12" style="text-align: center;">
            <div id="pagination"></div>
        </div>
    </div>
</div>

<!-- 表单弹窗容器 -->
<div id="formContainer" style="display: none; padding: 20px;">
    <form class="layui-form" id="studentForm">
        <div class="demo-reg-container">
            <!-- 姓名 -->
            <div class="layui-form-item">
                <div class="layui-input-wrap">
                    <div class="layui-input-prefix">
                        <i class="layui-icon layui-icon-username"></i>
                    </div>
                    <input type="text" name="name" lay-verify="required" placeholder="姓名" autocomplete="off" class="layui-input">
                </div>
            </div>

            <!-- 学号 -->
            <div class="layui-form-item">
                <div class="layui-input-wrap">
                    <div class="layui-input-prefix">
                        <i class="layui-icon layui-icon-form"></i>
                    </div>
                    <input type="text" name="number" lay-verify="required" placeholder="学号" autocomplete="off" class="layui-input">
                </div>
            </div>

            <!-- 性别 -->
            <div class="layui-form-item">
                <div class="layui-input-wrap">
                    <div class="layui-input-prefix">
                        <i class="layui-icon layui-icon-user"></i>
                    </div>
                    <select name="sex" lay-verify="required" class="layui-input">
                        <option value="">请选择性别</option>
                        <option value="男">男</option>
                        <option value="女">女</option>
                    </select>
                </div>
            </div>

            <!-- 年龄 -->
            <div class="layui-form-item">
                <div class="layui-input-wrap">
                    <div class="layui-input-prefix">
                        <i class="layui-icon layui-icon-date"></i>
                    </div>
                    <input type="number" name="age" lay-verify="required|number" placeholder="年龄" autocomplete="off" class="layui-input">
                </div>
            </div>

            <!-- 提交按钮 -->
            <div class="layui-form-item">
                <button class="layui-btn layui-btn-fluid" lay-submit lay-filter="student-add">提交</button>
            </div>
        </div>
    </form>
</div>

<script src="/js/layui.js"></script>
<script src="/pagejs/dp01.js"></script>
</body>
</html>